extends layout

block content
    -var imagelikes = image.likes ? image.likes : 0
    include includes/header.pug
    .container
        .row
            .card.col-12
                img.card-img-top(src=`/uploads/${image.diskfilename}`, alt=image.title)
                .card-body.d-flex.justify-content-between
                    div.inline-block
                        span= image.title
                        span= ' 上传者:'
                        span= uploader.nickname
                    div.inline-block
                        i.fa.fa-heart
                        span#likes-view= imagelikes
                        span 个赞
                    button.btn.btn-primary#likes-btn(data-imageid=image._id)
                        i.fa.fa-heart-o
                        | 赞
            .list-group.col-12
                each comment in comments
                    a.list-group-item
                        h5= comment.comment
                        p= comment.nickname
                        p= comment.email
        .row
            .card.col-12
                .card-body
                    h4.card-title 发表评论
                    form(action=`/comments/${image._id}`, method="post")
                        .form-group.row
                            label.col-12.col-md-2 邮箱
                            input.col-12.col-md-10.form-control(type="email", name="email")
                        .form-group.row
                            label.col-12.col-md-2 昵称
                            input.col-12.col-md-10.form-control(type="text", name="nickname")
                        .form-group.row
                            label.col-12.col-md-2 评论
                            textarea.col-12.col-md-10.form-control(rows="5", name="comment")
                        .form-group.row
                            .col-12.offset-md-8.col-md-4
                                button.btn.btn-primary.btn-block(type="submit") 保存评论
        include includes/footer.pug
      
    //- script(src='https://code.jquery.com/jquery-3.2.1.slim.min.js', integrity='sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN', crossorigin='anonymous')
    //- script.
    //-   window.jQuery || document.write('<script src="../../../../assets/js/vendor/jquery-slim.min.js"><\\/script>')
    //- script(src='../../../../assets/js/vendor/popper.min.js')
    //- script(src='../../../../dist/js/bootstrap.min.js')
    //- script(src='../../../../assets/js/vendor/holder.min.js')
    script(src="/javascripts/show.js")
    script.
        Holder.addTheme('thumb', {
        bg: '#55595c',
        fg: '#eceeef',
        text: 'Thumbnail'
        });